#ifndef __GIZA__
#define __GIZA__


#include "ulib.h"
#include <vector>

class CSource	{
public:
	CUStringList tok_list;
};

class CTarget	{
public:
	CUStringList tok_list;
};

class CAlign {
public:
	CUStringList align_list;
};

class CGiza {
public:
	CGiza();
	~CGiza();
	bool Open( char fn[] );
	bool CheckOpen( char fn[] );
	bool ReadSent();
	CSource src;
	CTarget tgt;
	CAlign align;
	CUString score;

	int num_sent;
	CUTextFile file;

	bool RecoverReorder( char info_fn[], char out_fn[], char lang = 'S' );
	bool RecoverInsert( char src_fn[], char out_fn[], char lang = 'S' );
	bool RecoverKor( char kinfo_fn[], char out_fn[] );

private:
	bool RecoverKor( CUString &kinfo );
	bool LoadTgt( CUString &str );
	bool LoadSrcAlign( CUString &str );
	void SaveOut( FILE *fp );
	void SwapList( CUStringList &src_list, int i, int j );
	bool Reorder( CUStringList &inf_list, char lang = 'S' );
	bool DeleteInsertedWords( CUStringList &src_list, char lang = 'S' );

} ;


#endif

